/**
 * Created by Salted fish
 * Description:
 * User: 24539
 * Date：2021-08-01
 * Time: 20:37
 */
public class Test1 {
    public static void main(String[] args) {
    double[] array={11,25,31,43,56,11,46,33};
        System.out.println("平均值是"+ avg(array));
    }
public static double avg(double[] array) {
        double sum=0.0;
    for(int i=0;i< array.length;i++) {
        sum += array[i];
    }
    return sum/ array.length;
    }
}
